package com.ask.threadcase2;

import com.ask.clonedemo.Main;

public class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(getName() + "@" + i);
            Thread.yield();
        }
    }

    public static void main(String[] args) throws InterruptedException {
        MyThread t1 = new MyThread();
        t1.setName("飞机线程");

        t1.start();
        t1.join();
        for (int i = 0; i < 10; i++) {
            System.out.println(currentThread().getName()+"@"+i);
        }


    }
}
